<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        // 修饰整个正则的  写在正则外边

        var reg = /^[abcd]$/i;
        // 从开头到结尾 只有一位 这一位是abcd中的任意一个 
        // 不管大小写 都满足要求 
        console.log(reg.test('a'));
        console.log(reg.test('b'));
        console.log(reg.test('c'));
        console.log(reg.test('d'));
        console.log(reg.test('A'));
        console.log(reg.test('B'));
        console.log(reg.test('C'));
        console.log(reg.test('D'));
        //上面全是true  下面false 
        console.log(reg.test('E'));
        console.log(reg.test('f'));
        console.log(reg.test('G'));
        console.log(reg.test('h'));



    </script>
</body>
</html>